package org.example.compent;

import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.annotation.LiteflowMethod;
import com.yomahub.liteflow.core.NodeComponent;
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
import com.yomahub.liteflow.enums.NodeTypeEnum;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@LiteflowComponent("z")
public class ZCmp {

    @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeType = NodeTypeEnum.COMMON)
    public void process(NodeComponent component) throws Exception {
        log.info("------Z结点,component:{}--------", component);
    }

    @LiteflowMethod(value = LiteFlowMethodEnum.IS_ACCESS, nodeType = NodeTypeEnum.COMMON)
    public boolean isAccess(NodeComponent component){
        log.info("-------------Z结点已执行------------");
        return true;
    }

    @LiteflowMethod(value = LiteFlowMethodEnum.BEFORE_PROCESS, nodeType = NodeTypeEnum.COMMON)
    public void before(NodeComponent component){
        log.info("-------------Z结点执行前------------");
    }

    @LiteflowMethod(value = LiteFlowMethodEnum.AFTER_PROCESS, nodeType = NodeTypeEnum.COMMON)
    public void after(NodeComponent component){
        log.info("-------------Z结点执行后------------");
    }
}
